// 简单的promise例子
const promise = new Promise(function(resolve, reject) {
    // resolve(100)
    reject(new Error('promise err'))
})
promise.then(function(value) {
    console.log("resoled",value)
},function(err) {
    console.log("rejected", err)
})


//题目
const promise = new Promise(function(resolve, reject) {
    resolve('成功')
    reject('promise err')
    resolve('成功2')
})
promise.then(function (value) {
    console.log(value)
})
.catch(function (e) {
    console.log(e)
})
.then(function (value) {
    console.log(value)
})
